package top.dreamyy.pattern.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import top.dreamyy.pattern.domain.User;

import static top.dreamyy.pattern.util.common.PatternConstants.USERTABLE;;

public interface UserDao {

	@Select("select *  from "+USERTABLE+" where name=#{name} and password = #{password}")
	User selecttUser(
			@Param("name") String name,
			@Param("password") String password);
	
	
	@Select("select *  from "+USERTABLE+" where name=#{name}")
	User existUser(
			@Param("name") String name);	
	
	
	@Insert("insert into "+USERTABLE+" values(#{name},#{password},#{stuid})")
	void insertUser(
			@Param("name") String name,
			@Param("password") String password,
			@Param("stuid") String stuid);
}
